Skip to content

added "formatter" to all functions that produce text edits directly - #2872

Open
jurgenvinju wants to merge 5 commits into
mainfrom
fix/better-names-in-util-formatting
Open

added "formatter" to all functions that produce text edits directly#2872
jurgenvinju wants to merge 5 commits into
mainfrom
fix/better-names-in-util-formatting

Conversation

@jurgenvinju

@jurgenvinju jurgenvinju commented Aug 28, 2026

Copy link
Copy Markdown
Member

This PR solidifies the support in util::Formatters for Box-based formatting with better function names, documentation, demo's and tests.

  • renames public API functions in util::Formatters to always have Formatter in their name. For example subTreeEdits is now called subTreeEditFormatter because it generates a formatter function that takes subTrees as arguments and produces edits as output that format the input.
  • added demo use of util::Formatter functions in the pico demo formatter;
  • extended pico formatter with more rules
  • added regression tests for util::Formatter functions using the pico demo
  • fixed errors in documentation of util::Formatter

@codecov

codecov Bot commented Aug 28, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 45%. Comparing base (4f96714) to head (6fc0fe8).

Additional details and impacted files
@@           Coverage Diff           @@
##              main   #2872   +/-   ##
=======================================
  Coverage       45%     45%           
- Complexity    6801    6808    +7     
=======================================
  Files          844     844           
  Lines        68785   68785           
  Branches     10023   10023           
=======================================
+ Hits         31344   31371   +27     
+ Misses       35066   35044   -22     
+ Partials      2375    2370    -5     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@DavyLandman DavyLandman left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

less chance of clashing 👍🏼 but it looks like the refactoring it not complete? (as the build is failing)

@toinehartman toinehartman left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Better names! Like @DavyLandman pointed out, the renaming is not complete, as the old names appear at use sites and in the tutor documentation in various places. I tried to point them all out.

Comment thread src/org/rascalmpl/library/util/Formatters.rsc Outdated
Comment thread src/org/rascalmpl/library/util/Formatters.rsc Outdated
Comment thread src/org/rascalmpl/library/util/Formatters.rsc Outdated
Comment thread src/org/rascalmpl/library/util/Formatters.rsc Outdated
Comment thread src/org/rascalmpl/library/util/Formatters.rsc Outdated
Comment thread src/org/rascalmpl/library/util/Formatters.rsc Outdated
Comment thread src/org/rascalmpl/library/util/Formatters.rsc Outdated
Comment thread src/org/rascalmpl/library/util/Formatters.rsc Outdated
Comment thread src/org/rascalmpl/library/util/Formatters.rsc Outdated
Comment thread src/org/rascalmpl/library/util/Formatters.rsc Outdated
@jurgenvinju

Copy link
Copy Markdown
Member Author

Thanks for the help @toinehartman. This is now ready to rumble.

@sonarqubecloud

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants